#include <bits/stdc++.h>

using namespace std;

#define int long long

typedef pair<int, int> pii;

const int MAXN = 2e5 + 10;
const int MOD = 1e9 + 7;

int n, q;

int tr1[MAXN], tr2[MAXN];
int r[MAXN], c[MAXN];
inline int lowbit(int x) {
    return x & (-x);
}

void add(int* tr, int i, int d) {
    while (i <= n) {
        tr[i] += d;
        i += lowbit(i);
    }
}

int sum(int* tr, int i) {
    int res = 0;
    while (i > 0) {
        res += tr[i];
        i -= lowbit(i);
    }
    return res;
}


signed main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    int t;
    int x, y, x1, x2, y1, y2;

    cin >> n >> q;
    while (q--) {
        cin >> t;
        if (t == 1) {
            cin >> x >> y;
            r[x]++, c[y]++;
            if (r[x] == 1) add(tr1, x, 1);
            if (c[y] == 1) add(tr2, y, 1);
        }
        else if (t == 2) {
            cin >> x >> y;
            r[x]--, c[y]--;
            if (r[x] == 0) add(tr1, x, -1);
            if (c[y] == 0) add(tr2, y, -1);
        }
        else {
            cin >> x1 >> y1 >> x2 >> y2;

            bool row = sum(tr1, x2) - sum(tr1, x1 - 1) >= x2 - x1 + 1;
            bool col = sum(tr2, y2) - sum(tr2, y1 - 1) >= y2 - y1 + 1;

            puts((row || col) ? "Yes" : "No");
        }
    }
    return 0;
}